package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface DishFlavorMapper {
    /**
     * 菜品新增口味
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 删除口味
     * @param id
     */
    @Delete("delete from sky_take_out.dish_flavor where dish_id=#{id}")
    void deleteById(Long id);

    /**
     * 根据菜品id查找口味
     * @param id
     * @return
     */
    @Select("select value,name from dish_flavor where dish_id=#{id}")
    List<DishFlavor> selectFlavorById(Long id);

}
